<template>
  <div class="VonInputHorizon" :style="customStyle">
    <div class="label" v-if="label">{{label}}</div>
    <el-input
            :placeholder="placeholder"
            v-bind="$attrs"
            v-on="$listeners"
            clearable
            :show-password="showPassword"
            :suffix-icon="suffix?'el-icon-search':''">
    </el-input>
  </div>
</template>

<script>
  export default {
    name: "VonInputHorizon",
    data() {
      return {

      }
    },
    props: {
      suffix: {
        type: Boolean,
        default: false
      },
      placeholder: {
        type: String,
        default: ''
      },
      showPassword: {
        type: Boolean,
        default: false,
      },
      width: {
        type: String,
        default: '300px'
      },
      height: {
        type: String,
        default: '44px'
      },
      label: {
        type: String,
        default: ''
      }
    },
    computed: {
      customStyle() {
        let styleObj = {};
        styleObj.width = this.width;
        styleObj.height = this.height;
        styleObj.lineHeight = this.height;
        return styleObj;
      }
    }
  }
</script>

<style lang="scss">

  .VonInputHorizon {
    margin: 10px;
    width: 100%;
    display: flex;
    .label {
      width: 150px;
      height: 40px;
      line-height: 40px;
      color: white;
      font-size: 16px;
      text-align: right;
    }

    .el-input {
      .el-input__inner {
        height: 40px;
        line-height: 40px;
        color: white !important;
        background: rgba(111, 117, 131, 0.3);
        padding: 0 4px;
        color: #1acc8f;
      }
    }
  }
</style>
